import { MessageContent } from "wukongimjssdk";

export class ServerStatusContent extends MessageContent {

  content!: string;
  type!: number;

  constructor(code: number) {
    super();
    this.contentType = code;
  }

  // 解码
  decodeJSON(content: any) {
    this.content = content["content"];
    this.type = content["type"];
  }
  // 编码
  encodeJSON() {
    return {
      content: this.content,
      type: this.type,
      _no: true
    };
  }
}

export default {
  // 消息类型名称
  name: "wecat-info",
  // 消息类型内容
  content: ServerStatusContent,
};
